<%
//用户
var user = shiro.getUser();
var title  = '投诉/建议';
layout("/inc/layout.html",{
title:title,
keywords:title,
description:title,
style:'user.css'
}){
%>
<section class="container">
    <div class="row mt15 text-left">
        <ul class="breadcrumb">当前位置：
            <li><a href="/">主页</a></li>
            <li>${decode(type,1,"投诉",2,"建议","投诉建议")}</li>
        </ul>
    </div>
</section>
<section class="container">
    <div class="row  mt15">
        <div id="location-box">
            <div class="panel panel-primary">
                <div class="panel-heading text-left ">
                    <ul class="nav nav-pills">
                        <li class="active ">
                            <a href="/suggestion/apply/${decode(type,1," 1",2,"2","")}"><b>${decode(type,1,"投诉",2,"建议","投诉建议")}</b></a>
                        </li>
                    </ul>
                </div>
                <div class="panel-body">
                    <h5 class="alert alert-warning">提醒：带*的地方为必填项，请根据实际情况填写。</h5>
                    <!--项目状态-->
                    <form class="form-horizontal col-sm-offset-1 col-sm-9" id="saveSuggestionForm">
                        <input type="hidden" name="id" id="id" value="${id!}">

                        <div class="form-group">
                            <label for="name" class="col-sm-2 control-label"><i class="text-danger">*</i>姓名：</label>
                            <div class="col-sm-4">
                                <input type="text" id="name" name="userName" class="form-control" placeholder="请输入联系人姓名"
                                       required>
                                <b class="text text-danger"></b>
                            </div>
                            <label for="phone" class="col-sm-2 control-label"><i class="text-danger">*</i>手机：</label>
                            <div class="col-sm-4">
                                <input type="text" id="phone" name="phone" maxlength="11" minlength="11"
                                       oninput="value=value.replace(/[^\d]/g,'')" class="form-control"
                                       placeholder="请输入联系人手机" required>
                                <b class="text text-danger"></b>
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="address" class="col-sm-2 control-label">地址：</label>
                            <div class="col-sm-4">
                                <input type="text" id="address" name="address" class="form-control" placeholder="请输入地址">
                                <b class="text text-danger"></b>
                            </div>
                            <label for="card" class="col-sm-2 control-label"><i class="text-danger">*</i>身份证：</label>
                            <div class="col-sm-4">
                                <input type="text" id="card" name="cardNumber" maxlength="18" minlength="18"
                                       oninput="value=value.replace(/[^\d]/g,'')" class="form-control"
                                       placeholder="请输入身份证" required/>
                                <b class="text text-danger"></b>
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="email" class="col-sm-2 control-label">邮箱：</label>
                            <div class="col-sm-4">
                                <input type="email" id="email" name="email" class="form-control" placeholder="请输入邮箱">
                                <b class="text text-danger"></b>
                            </div>
                            <label for="orgId" class="col-sm-2 control-label"><i class="text-danger">*</i>部门：</label>
                            <div class="col-sm-4">
                                <select class="form-control" name="orgId" id="orgId">
                                    <% for(org in orgList ){%>
                                    <option value="${org.id!}">${org.deptName!}</option>
                                    <%}%>
                                </select>
                                <b class="text text-danger" id="cardType-error"></b>
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="title" class="col-sm-2 control-label"><i class="text-danger">*</i>标题：</label>
                            <div class="col-sm-4">
                                <input type="text" id="title" name="title" class="form-control" placeholder="请输入标题"
                                       required>
                                <b class="text text-danger"></b>
                            </div>
                            <label for="serviceName" class="col-sm-2 control-label"><i
                                    class="text-danger">*</i>事项：</label>
                            <div class="col-sm-4">
                                <input type="text" id="serviceName" name="serviceName" class="form-control"
                                       placeholder="请输入事项名" required>
                                <b class="text text-danger"></b>
                            </div>
                            <div class="col-sm-4" id="distpicker" style="display: none">
                                <select class="form-control" name="type" id="type">
                                    <%if(type==1||type==0){%>
                                    <option value="1" ${type==1?"selected"}>投诉</option>
                                    <% }else if(type==2||type==0){%>
                                    <option value="2" ${type==2?"selected"}>建议</option>
                                    <%}%>
                                </select>
                                <b class="text text-danger" id="cardType-error"></b>
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="node" class="col-sm-2 control-label"><i class="text-danger">*</i>${decode(type,1,"投诉内容",2,"建议内容","投诉/建议内容")}：</label>
                            <div class="col-sm-10">
                                <textarea class="col-sm-12" rows="12" style="resize: none;" name="content"></textarea>
                            </div>
                        </div>
                    </form>
                </div>
                <div class="panel-footer">
                    <div class="col-sm-offset-3 clearfix">
                        <div class="mt5 mb5 block col-sm-3">
                            <a href="/user/suggestion" class="btn btn-warning btn-lg btn-outline btn-block">我的${decode(type,1,"投诉",2,"建议","投诉/建议")}</a>
                        </div>
                        <div class="mt5 mb5 block col-sm-3">
                            <button type="button" id="doSubmit" class="btn btn-danger btn-lg btn-outline btn-block">提交
                            </button>
                        </div>
                    </div>
                </div>
            </div>
        </div>
</section>
<% } %>
<script>
    require(['modules/suggestion'], function (suggestion) {
        suggestion.info();
    });
</script>
</body>
</html>